package com.anlu.base;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Cash {

    private int amount;

    void plus(int added){
        amount += added;
    }

    boolean minus(int subtrahend){
        if (amount >= subtrahend) {
            amount -= subtrahend;
            return true;
        } else {
            return false;
        }
    }

    int count(){
        return amount;
    }
}
